package common.DROID;

import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import android.widget.TextView;
import android.view.*;
import android.view.GestureDetector.SimpleOnGestureListener;

public class DROID extends Activity {
    /** Called when the activity is first created. */
	int buttoncount;
	Button btn;  
	TextView tv;
	EditText et;
	private static final int LARGE_MOVE = 60;
	private GestureDetector gestureDetector;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        et = (EditText)findViewById(R.id.EditText01);
        tv = (TextView)findViewById(R.id.TextView01);
        btn = (Button)findViewById(R.id.Button01);
        btn.setText("Begin");
        et.setText("Enter Name Here");
        tv.setText("");
        gestureDetector = new GestureDetector(this,
        		new SimpleOnGestureListener() {
        		@Override
        		public boolean onFling(MotionEvent e1, MotionEvent e2,
        		float velocityX, float velocityY) {
        			if (e1.getY() - e2.getY() > LARGE_MOVE) {
        				tv.append( "\nFling Up with velocityY:" + velocityY + " velocityX:" + velocityX);
        				return true;
        				} else if (e2. getY() - e1.getY() > LARGE_MOVE) {
        				tv.append( "\nFling Down with velocityY:" + velocityY + " velocityX:" + velocityX);
        				return true;
        				} else if (e1. getX() - e2.getX() > LARGE_MOVE) {
        				tv.append( "\nFling Left with velocityY:" + velocityY + " velocityX:" + velocityX);
        				return true;
        				} else if (e2. getX() - e1.getX() > LARGE_MOVE) {
        				tv.append( "\nFling Right with velocityY:" + velocityY + " velocityX:" + velocityX);
        				return true;
        				}
        				return false;
        				} });
        		
    }
    public void btnClick(View view){
    	for (int i = 0; i < 1; i++)
    	{tv.setText(tv.getText() + " " + et.getText() + " is an idiot");}
    	btn.setText("MORE"+buttoncount);
    	buttoncount++;
    	if(buttoncount == 2){Toast.makeText(this, et.getText() + " is DOUBLE an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);}
    	if(buttoncount == 10){Toast.makeText(this, et.getText() + " is MULTI an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);}
    	if(buttoncount == 20){Toast.makeText(this, et.getText() + " is ULTRA an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);}
    	if(buttoncount == 40){Toast.makeText(this, et.getText() + " is MONSTER an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);}
    	if(buttoncount == 80){Toast.makeText(this, et.getText() + " is MMMONSTER an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);}
    	if(buttoncount == 120){Toast.makeText(this, "Stop pressing the button, you are an idiot", 1).show();
    	btn.setTextScaleX(btn.getTextScaleX()+1);buttoncount = 990;}
    }
    @Override
    public boolean onTouchEvent(MotionEvent event) {
    return gestureDetector. onTouchEvent(event);
    }
    public void editTextClick(View view){
    	et.setText("");
    }
    
    
}